package com.shycloud.mido.member.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.member.api.dto.FavoriteTeacherDTO;
import com.shycloud.mido.member.api.dto.TeacherDTO;
import com.shycloud.mido.member.api.entity.OrgTeacherDetailed;
import com.shycloud.mido.member.api.entity.Teacher;
import com.shycloud.mido.member.api.vo.MyTeacherVO;
import com.shycloud.mido.member.api.vo.StudentVO;
import com.shycloud.mido.member.api.vo.TeacherVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 教师管理
 *
 * @author jtzhang
 * @date 2019-03-08 13:16:46
 */
public interface TeacherMapper extends BaseMapper<Teacher> {

	/**
	 * 分页查询教师信息
	 *
	 * @param page       分页
	 * @param teacherDTO 查询参数
	 * @return list
	 */
	IPage<List<TeacherVO>> getTeacherVosPage(Page page, @Param("query") TeacherDTO teacherDTO);

	/**
	 * 通过id锁定教师
	 *
	 * @param ids ids
	 * @return
	 */
	boolean lockByIds(@Param("ids") List<String> ids);

	/**
	 * 通过id解锁教师
	 *
	 * @param ids ids
	 * @return
	 */
	boolean unlockByIds(@Param("ids") List<String> ids);

	/**
	 * 通过id删除教师
	 *
	 * @param ids ids
	 * @return
	 */
	boolean deleteByIds(@Param("ids") List<String> ids);

	/**
	 * 查询科目
	 *
	 * @param memberId
	 * @return
	 */
	List<String> getTeacherSubjectId(@Param("memberId") String memberId);

	/**
	 * 查询证书照片
	 *
	 * @param memberId
	 * @return
	 */
	List<String> getTeacherProPic(@Param("memberId") String memberId);

	/**
	 * 查询教师信息表信息
	 *
	 * @param memberId
	 * @return
	 */
	TeacherVO getTeacher(@Param("memberId") String memberId);

	/**
	 * 学生收藏教师详情
	 *
	 * @param memberId 教师ID
	 * @return
	 */
	FavoriteTeacherDTO favoriteTeacher(@Param("memberId") String memberId);

	/**
	 * 获取教师信息
	 *
	 * @param memberId 会员id
	 * @return R
	 */
	Teacher getByMemberId(@Param("memberId") String memberId);

	/**
	 * 获取会员身份
	 *
	 * @param memberId 会员Id
	 * @return list
	 */
	List<String> getMembership(@Param("memberId") String memberId);

	/**
	 * 获取认证身份
	 *
	 * @param memberId 会员Id
	 * @return list
	 */
	List<String> getAttestation(@Param("memberId") String memberId);

	/**
	 * 获取学生列表
	 *
	 * @param page
	 * @param groupId
	 * @param id
	 * @return java.util.List<com.shycloud.mido.member.api.vo.StudentVO>
	 * @author nianhua.jiang
	 * @date 2020/6/20 10:41
	 */
	IPage<StudentVO> getStudentDetail(@Param("page") Page page, @Param("groupId") Integer groupId, @Param("id") String id);

	IPage<StudentVO> getStudentDetailV2(@Param("page") Page page, @Param("groupId") Integer groupId, @Param("id") String id,
			@Param("studentName") String studentName);

	/**
	 * 获取我的老师
	 *
	 * @param teacherId
	 * @return com.shycloud.mido.member.api.vo.MyTeacherVO
	 * @author nianhua.jiang
	 * @date 2020/6/22 17:51
	 */
	MyTeacherVO getMyTeacher(@Param("teacherId") String teacherId);

	/**
	 * 教师获取学生数量
	 *
	 * @param teacherId
	 * @return int
	 * @author nianhua.jiang
	 * @date 2020/6/23 17:59
	 */
	int getStudentCount(@Param("teacherId") String teacherId);


	IPage<StudentVO> getStudentByParent(@Param("page") Page page, @Param("orgId") Integer orgId, @Param("memberId") String memberId);

	StudentVO getStudentInfo(@Param("studentId") String studentId);

	IPage<StudentVO> searchStudent(@Param("page") Page page, @Param("name") String name, @Param("teacherId") String teacherId);

	int removeTeacherGroup(@Param("studentId") String studentId);

	//小程序用
	List<StudentVO> getStudentList(@Param("teacherId") String teacherId);

	StudentVO getStudent(@Param("studentId") String studentId);

	OrgTeacherDetailed getTeacherByStu(@Param("studentId") String studentId);

	OrgTeacherDetailed getTeacherByUsername(@Param("teaUsername") String teaUsername);

	TeacherVO getTeacherInfo(@Param("teacherId") String teacherId);

	OrgTeacherDetailed getTeacherByMemberId(@Param("memberId") String memberId);
}
